<!-- 图标形式-柱状图 -->
<template>
    <div class="charts" ref="barchart"> </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
    name: 'BarCharts',
    mounted() {
        this.initCharts();
    },
    methods: {
        initCharts() {        
            let barCharts = echarts.init(this.$refs.barchart);
            barCharts.setOption({
                xAxis: {
                    show: false,  //隐藏X轴
                    tyep: 'category', // 均分，会对数据进行排序
                },
                yAxis: {
                    show: false,  //隐藏                    
                },
                series: [
                    {
                        //图标形式-柱状图
                        type: "bar",
                        data: [10, 7, 33, 12, 48, 9, 29, 10, 44, 33, 22, 8],
                        color: 'cyan'
                    },
                ],
                //布局调试
                grid: {
                    left: 0,
                    top: 0,
                    right: 0,
                    bottom: 0,
                },
                tooltip: {}

            });
        },
    },


}
</script>

<style scoped>
.charts {
    width: 100%;
    height: 100%;
}
</style>